package com.koron.order.defect.service;

import com.github.pagehelper.PageInfo;
import com.koron.bean.query.PageQuery;
import com.koron.common.core.business.common.service.CommonService;
import com.koron.order.defect.bean.dto.DefectDTO;
import com.koron.order.defect.bean.dto.DefectEquipmentDto;
import com.koron.order.defect.bean.dto.SzlsDefectDto;
import com.koron.order.defect.bean.po.DefectBean;
import com.koron.order.defect.bean.po.DefectSta;
import com.koron.order.defect.bean.query.DefectEquipmentQuery;
import com.koron.order.defect.bean.query.DefectQuery;
import com.koron.order.defect.bean.vo.DefectDetailVo;
import com.koron.order.defect.bean.vo.DefectVO;
import org.koron.ebs.mybatis.SessionFactory;

import java.util.List;
import java.util.Map;

public interface DefectService extends CommonService {

    DefectBean saveOrUpdate(SessionFactory factory, DefectDTO defectDTO);

    int update(SessionFactory factory, DefectDTO defectDTO);

    int delete(SessionFactory factory, List<String> list);

    DefectDetailVo queryById(SessionFactory factory, String id);

    List<DefectBean> queryList(SessionFactory factory, DefectQuery query);

    PageInfo<DefectVO> queryDefectVoList(SessionFactory factory, DefectQuery query, PageQuery pageQuery);

    List<SzlsDefectDto> lightWaterQueryDefectByYear(SessionFactory factory, SzlsDefectDto dto);

    int submitDefect(SessionFactory factory, String orderId, String status);

    int activePending(SessionFactory factory, String orderId);

    int activePendingAuto(SessionFactory factory, String currDs);

    List<DefectEquipmentDto> queryEquipmentDefectNums(SessionFactory factory, List<DefectEquipmentQuery> defectEquipmentQueryList);

    List<DefectEquipmentDto> queryEquipmentDefectNumsByIds(SessionFactory factory, List<String> defectEquipmentIds);

    String deprecated(SessionFactory factory, String orderId);

    String deprecatedBatch(SessionFactory factory, List<String> orderIds);

    DefectBean updateDefect(SessionFactory factory, DefectDTO defectDTO);

    int updateInfo(SessionFactory factory,Map<String,Object> param);

    Map getRateOfDefect(SessionFactory factory,String startTime, String endTime);

    Map getRateImmediateOfDefect(SessionFactory factory,String startTime, String endTime);

    Map rateOfDefect(SessionFactory factory,String startTime, String endTime);

    Map<String, List<DefectSta>> staDefect(SessionFactory factory, String startTime, String endTime);

    List<Map<String,Integer>> getDefectStock(SessionFactory factory);
}
